//
//  GGTGetBusinessTableViewCell.m
//  GGT
//
//  Created by 空空空 on 14/11/4.
//  Copyright (c) 2014年 GGT. All rights reserved.
//

#import "GGTGetBusinessTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation GGTGetBusinessTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.nameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.nameLabel];
        self.imgView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imgView];
        self.currentLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.currentLabel];
//        self.listLabel = [[GGTDeleteLabel alloc]init];
//        [self.contentView addSubview:self.listLabel];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.imgView setImageWithURL:[NSURL URLWithString:self.getBusiness.image] placeholderImage:[UIImage imageNamed:@"hold.png"]];
    self.nameLabel.text = self.getBusiness.title;
    self.currentLabel.text = [NSString stringWithFormat:@"￥%@", self.getBusiness.current_price];
    self.listLabel.text = [NSString stringWithFormat:@"￥%@", self.getBusiness.list_price];
    self.imgView.frame = CGRectMake(10, 10, self.contentView.frame.size.width / 4, self.contentView.frame.size.height - 20);
    self.nameLabel.frame = CGRectMake(self.contentView.frame.size.width / 4 + 20,10, self.contentView.frame.size.width / 4 * 3 - 20, self.contentView.frame.size.height / 2);
    self.currentLabel.frame = CGRectMake(self.contentView.frame.size.width / 4 + 20, self.contentView.frame.size.height / 2, self.contentView.frame.size.width / 4, self.contentView.frame.size.height / 2);
    self.listLabel.frame = CGRectMake(self.contentView.frame.size.width / 4 + 20 + self.contentView.frame.size.width / 4, self.contentView.frame.size.height / 2, self.contentView.frame.size.width / 4, self.contentView.frame.size.height / 2);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)dealloc
{
    [_nameLabel release];
    [_currentLabel release];
    [_listLabel release];
    [_imgView release];
    [_getBusiness release];
    [super dealloc];
}
@end
